package cn.gson.fengboot.model.service;

import cn.gson.fengboot.model.dao.LchuchaDo;
import cn.gson.fengboot.model.mapper.LchuchaMapper;
import cn.gson.fengboot.model.pojos.Lchucha;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional(rollbackFor =  Exception.class)
public class LchuchaService {
    @Autowired
    LchuchaDo lchuchaDo;
    @Autowired
    LchuchaMapper lchuchaMapper;

    //查询出差记录
    public List<Lchucha> cxchucha(String search,String fenlei){
        return lchuchaMapper.cxchucha(search,fenlei);
    }

    @Transactional(transactionManager = "transactionManager")
    //新增出差记录
    public  void addchucha(Lchucha ltousu){
        lchuchaDo.save(ltousu);
    }
}
